#Twisted Shootout
#Copyright (C) 2007  Han Dao
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.

#You can contact the author at wikipediankiba@gmail.com

import pygame
import data
import booster
class PlayerAnim:
	def __init__(self,p):
		self.p = p
		self.sprites = self.p.sprites
		self.d = data.read
		self.booster = booster.Booster()
		self.boost = False
	def imageload(self):
		if self.p.melee == False:
			self.normal()
		if self.p.melee == True:
			self.melee()
	def melee(self):
		self.p.name, self.p.image = data.read.load('pmelee')
	def normal(self):
		self.p.name, self.p.image = data.read.load('player')
	def booston(self):
		self.boost = True
		self.booster.rect.x = self.p.rect.x + 15
		self.booster.rect.y = self.p.rect.y + 50
		self.sprites.add(self.booster)
	def boostoff(self):
		if self.boost == True:
			self.sprites.remove(self.booster)
			self.boost = False
	def execute(self):
		if self.boost == True:
			self.booster.change()